﻿<?xml version="1.0" encoding="utf-8"?>
<Window
    x:Class="Automator.Windows.LogVisualizer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:classes="clr-namespace:Automator.Classes"
    Title="Log Visualizer"
    WindowStartupLocation="CenterOwner"
    Width="359"
    Height="208"
    MinWidth="359"
    MinHeight="208"
    Background="{x:Static SystemColors.ControlBrush}">
    <Window.Resources>
        <classes:LogImageConverter
            x:Key="LogImageConverter" />
        <classes:LogDateTimeConverter
            x:Key="LogDateTimeConverter" />
    </Window.Resources>
    <DockPanel
        LastChildFill="True"
        x:Name="pnlContent">
        <StackPanel
            Orientation="Horizontal"
            DockPanel.Dock="Top"
            Margin="4">
            <Image
                Width="16"
                Height="16"
                Source="{Binding Path=MessageType, Converter={StaticResource LogImageConverter}}"
                Margin="2,4,8,4"
                VerticalAlignment="Center"
                HorizontalAlignment="Center" />
            <TextBlock
                Text="{Binding Path=MessageTime, Converter={StaticResource LogDateTimeConverter}}"
                VerticalAlignment="Center" />
        </StackPanel>
        <TextBox
            TextWrapping="Wrap"
            IsReadOnly="True"
            IsReadOnlyCaretVisible="False"
            Padding="4"
            Text="{Binding Path=Message, Mode=OneWay}" VerticalScrollBarVisibility="Auto"/>
    </DockPanel>
</Window>